All Questions
15 questions
5votes
1answer
76views
Parsing Lists: BIO 2024 Q2
I was practising question 2a of the British Informatics Olympiad 2024 past paper. In this task you will manipulate lists of integers to create new lists. There are three fundamental lists that you ...
8votes
1answer
2kviews
Mathematical expression evaluator (C++)
I'm new to C++ and I decided to experiment with the language, by writing a mathematical expression evaluator, using the Shunting-Yard algorithm. A design choice that may stand out as weird is the fact ...
4votes
1answer
150views
Preprocessing invalid xml before feeding it to a parser
As part of a larger project I'm writing to learn C++, I'm trying to read through some almost-XML files generated by another program. Unfortunately this program uses its own custom escaping logic, so ...
3votes
0answers
68views
Implementing chat commands [closed]
I'm new to C++ and I'm writting some kind of chat server and client who talk to each other through commands for learning purposes. I serialize and deserialize these commands using a JSON library. My ...
3votes
1answer
1kviews
A simple TCP command executer
In https://github.com/pc-magas/tcp_command as an attempt to learn C++ I made a simplistic TCP server in GNU/Linux that will receives simple "commands" in ASCII form. Each command ends with '\n' and a ...
7votes
1answer
2kviews
Overloading istream>> to read comma-separated input
I have the following very simple class: ...
7votes
3answers
6kviews
Splitting std::string based on delimiter using only find and substr
I have been playing around with these two functions for a bit, dunno if this is practical though. I have only been learning C++ for a couple of days, coming from a Java background. There we had a ...
14votes
2answers
2kviews
Parsing Z80 assembler in C++
I'm just starting with C++ (I have worked with C for more than a year) and as a first program I wanted to write a cleaner version of my Z80 assembler I had written in C before, this time trying to do ...
6votes
2answers
877views
Stack based recursive arithmetic expression parser
I recently started to learn C++ and came across this problem in a book "Object Oriented Programming in C++" by Robert Lafore. The author has a program in the book which creates a Parser. I found a ...
6votes
3answers
273views
Code Generator Generator
I've created a code generator generator, which is hosted here. I need its parser portion reviewed for OOP, OOD, and C++ best practices. gengenparser.h ...
5votes
2answers
366views
Optimizing simple xHTML parser
I'm writing a simple xHTML parser which parses a data without nested tags. Example input code will look like: ...
4votes
2answers
881views
Parsing argv with while-switch construct
I've been thinking about how to create a robust function that parses the command line arguments for valid filenames. I came up with a while-switch construct because that allows me to reduce redundancy ...
12votes
1answer
1kviews
Parsing numbers from equations into strings
This is my first code in C++. Since I'm new to the language, I'm just looking for pointers on what can be made better. I tried to cut out unnecessary stuff, but there are some comments in there. I ...
1vote
1answer
356views
Converting Bash commands into Windows cmd commands
I have the following code that converts a couple of bash commands into Windows cmd commands, as well as adding some commands. This is only my second day programming ...
6votes
1answer
278views
"Best before" puzzle
I'm new To C++ and decided to have a go at the Spotify challenges on their website. I have now finished but I get the feeling my code is just terrible. I'm guessing it would be very hard for someone ...